#include "C.header.h"

int main(int argc, char *argv[]) {
	WSADATA wsa;
	int retval;

	if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0) {
		puts("Startup() Error");
		return -1;
	}

	SOCKET cSock;
	cSock = socket(AF_INET, SOCK_STREAM, 0);
	if (cSock == INVALID_SOCKET) {
		err_quit("Socket() Error");
		return -1;
	}

	retval = cConnect(cSock);
	if (retval == SOCKET_ERROR) {
		err_quit("Connect() Error");
		return -1;
	}

	char buf[BUFSIZE + 1];
	while (1) {
		data_send(cSock, buf);
		data_recv(cSock, buf);
	}
	closesocket(cSock);
	WSACleanup();

	return 0;
}